//封装ajax库
function ajax(url,fnSucc,fnFail){
    //创建ajax对象
    if(window.XMLHttpRequest){
    	var oAjax = new XMLHttpRequest(); //非IE6
    }else{
    	var oAjax = new ActiveXObject("Microsoft.XMLHTTP"); //IE6
    }

    //连接服务器
    oAjax.open('GET',url,true);

    //发送请求
    oAjax.send();

    //接收响应
    oAjax.onreadystatechange = function(){
    	if(oAjax.readyState == 4){    //读取完成
    		if(oAjax.status == 200){  //读取成功
    			fnSucc(oAjax.responseText);   //读取成功调用fnSucc函数返回服务器响应
    		}else{
    			fnFail(oAjax.status);       //读取失败调用fnFail函数返回错误信息
    		}
    		
    	}
    }
}